#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <map>
using namespace std;
int prime[10000] = { 0 };
int v[40010] = { 0 };
int arr[100010] = { 0 };
int m = 0;
void get_prime(int n)
{
	
	for (int i = 2; i < n; i++)
	{
		if (v[i] == 0)
		{
			v[i] = i;
			prime[m++] = i;
		}
		for (int j = 0; j < m; j++)
		{
			if (prime[j] * i > n || prime[j] > v[i]) break;

			v[i * prime[j]] = prime[j];
		}
	}
}

int main()
{
	get_prime(40000);
	int t = 0;
	cin >> t;
	while (t--)
	{
		map<int, int> p;

		int n = 0;
		cin >> n;

		int flag = 0;
		for (int i = 0; i < n; i++)
		{
			scanf("%d", arr + i);
		}
		for (int i = 0; i < n; i++)
		{
			int num = arr[i];
			for (int i = 0; i<m; i++)
			{
				if (num % prime[i] == 0)
				{
					int pr = prime[i];
					while (num % pr == 0)
					{
						num /= pr;
					}
					p[pr]++;
					if (p[pr] > 1)
					{
						flag = 1;
						break;
					}
				}
				
			}
			if (flag) break;
			if (num > 1)
			{
				p[num]++;
				if (p[num] > 1)
				{
					flag = 1;
					break;
				}
			}
		}
		
		if (flag) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	
	return 0;
}